Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

[Ingest-Manager] Implementation for the Deploy scenario of the stand-alone mode#140

Merged
mdelapenya merged 15 commits intoelastic:masterfrom
mdelapenya:ingest-manager-deploy-stand-alone-impl
Jun 24, 2020
Merged

[Ingest-Manager] Implementation for the Deploy scenario of the stand-alone mode#140
mdelapenya merged 15 commits intoelastic:masterfrom
mdelapenya:ingest-manager-deploy-stand-alone-impl

Conversation

@mdelapenya
Copy link
Contributor

@mdelapenya mdelapenya commented Jun 18, 2020

What does this PR do?

It adds the code for checking that there are documents in the index. To achieve it, we use the query provided here: #126 (comment)

To perform this query, we need the hostname, which in a docker container matches the container id. Nevertheless, we execute the hostname command in the agent container.

To query Elasticsearch when security is enabled, we had to refactor a bit the existing helper methods for querying, adding authentication to the creation of the ES client. Besides that, we refactored the helper method to check for hits in an ES response.

Why is it important?

It puts in green the three BDD scenarios for the stand-alone mode of the Elastic Agent

Follow-up considerations

I noticed in Kibana that the hits always belong to this index: "logs-agent-default", that's why I'm hardcoding it.

@mdelapenya mdelapenya self-assigned this Jun 18, 2020
@mdelapenya mdelapenya requested review from a team, EricDavisX and michalpristas June 18, 2020 21:43
return err
}

esQuery := map[string]interface{}{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translated query from: #126 (comment)


cfg := es.Config{
Addresses: []string{fmt.Sprintf("http://%s:%d", host, port)},
Username: "elastic",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran locally other tests using the ES client, and they pass!

Comment on lines +24 to +31
// queryMaxAttempts is the number of attempts to query elasticsearch before aborting
// It can be overriden by OP_QUERY_MAX_ATTEMPTS env var
var queryMaxAttempts = 5

// queryRetryTimeout is the number of seconds between elasticsearch retry queries.
// It can be overriden by OP_RETRY_TIMEOUT env var
var queryRetryTimeout = 3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow-up improvement, I'm considering converting this basic retry into the backoff strategy. So it's in the TODO

@ghost
Copy link

ghost commented Jun 18, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #140 updated]

  • Start Time: 2020-06-24T09:24:12.177+0000

  • Duration: 23 min 54 sec

Test stats 🧪

Test Results
Failed 1
Passed 50
Skipped 9
Total 60

Test errors

Expand to view the tests failures

  • Name: Initializing / Tests / Sanity checks / golangcilint – pre_commit.lint

    • Age: 4
    • Duration: 0
    • Error Details: error

Log output

Expand to view the last 100 lines of log output

[2020-06-24T09:43:06.236Z] 
Creating metricbeat_mysql_1 ... done
Found orphan containers (metricbeat_mysql_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[2020-06-24T09:43:06.236Z] metricbeat_elasticsearch_1 is up-to-date
[2020-06-24T09:43:06.236Z] Creating metricbeat_metricbeat_1 ... 
[2020-06-24T09:43:06.236Z] 
Creating metricbeat_metricbeat_1 ... done
time="2020-06-24T09:43:05Z" level=info msg="Metricbeat is running configured for the service" metricbeatVersion=7.7.0 service=mysql serviceVersion=8.0.13 variant=MySQL
[2020-06-24T09:43:28.214Z] time="2020-06-24T09:43:25Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=32.387766ms index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=1
[2020-06-24T09:43:28.214Z] time="2020-06-24T09:43:26Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=553.612759ms index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=2
[2020-06-24T09:43:28.214Z] time="2020-06-24T09:43:27Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=1.313747003s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=3
[2020-06-24T09:43:29.157Z] time="2020-06-24T09:43:28Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=2.883729742s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=4
[2020-06-24T09:43:34.450Z] time="2020-06-24T09:43:33Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=8.046219116s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=5
[2020-06-24T09:43:38.660Z] time="2020-06-24T09:43:38Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=12.364062126s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=6
[2020-06-24T09:43:45.251Z] time="2020-06-24T09:43:45Z" level=warning msg="Waiting for more hits in the index" currentHits=4 desiredHits=5 elapsedTime=19.276196879s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=7
[2020-06-24T09:43:49.461Z] time="2020-06-24T09:43:49Z" level=warning msg="Waiting for more hits in the index" currentHits=4 desiredHits=5 elapsedTime=23.269251s index=metricbeat-7.7.0-mysql-mysql-8.0.13-svphzhva retry=8
[2020-06-24T09:43:57.610Z] time="2020-06-24T09:43:56Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=30.2492855s retries=9
[2020-06-24T09:43:57.610Z] time="2020-06-24T09:43:56Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=5.698592ms retries=1
[2020-06-24T09:43:57.610Z] Stopping metricbeat_metricbeat_1 ... 
[2020-06-24T09:43:57.610Z] 
Stopping metricbeat_metricbeat_1 ... done
Removing metricbeat_metricbeat_1 ... 
[2020-06-24T09:43:57.610Z] 
Removing metricbeat_metricbeat_1 ... done
Going to remove metricbeat_metricbeat_1
[2020-06-24T09:43:57.873Z] Stopping metricbeat_mysql_1 ... 
[2020-06-24T09:44:00.432Z] 
Stopping metricbeat_mysql_1 ... done
Removing metricbeat_mysql_1 ... 
[2020-06-24T09:44:00.694Z] 
Removing metricbeat_mysql_1 ... done
Going to remove metricbeat_mysql_1
[2020-06-24T09:44:01.267Z] Pulling mysql (docker.elastic.co/integrations-ci/beats-mysql:percona-5.7.24-1)...
[2020-06-24T09:44:01.839Z] percona-5.7.24-1: Pulling from integrations-ci/beats-mysql
[2020-06-24T09:44:08.433Z] metricbeat_elasticsearch_1 is up-to-date
[2020-06-24T09:44:08.433Z] Creating metricbeat_mysql_1 ... 
[2020-06-24T09:44:31.826Z] 
Creating metricbeat_mysql_1 ... done
Found orphan containers (metricbeat_mysql_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[2020-06-24T09:44:31.826Z] metricbeat_elasticsearch_1 is up-to-date
[2020-06-24T09:44:31.826Z] Creating metricbeat_metricbeat_1 ... 
[2020-06-24T09:44:31.826Z] 
Creating metricbeat_metricbeat_1 ... done
time="2020-06-24T09:44:31Z" level=info msg="Metricbeat is running configured for the service" metricbeatVersion=7.7.0 service=mysql serviceVersion=5.7.24 variant=Percona
[2020-06-24T09:44:53.810Z] time="2020-06-24T09:44:51Z" level=warning msg="Waiting for more hits in the index" currentHits=1 desiredHits=5 elapsedTime=7.333854ms index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=1
[2020-06-24T09:44:53.810Z] time="2020-06-24T09:44:51Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=312.743894ms index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=2
[2020-06-24T09:44:53.810Z] time="2020-06-24T09:44:53Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=1.79579874s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=3
[2020-06-24T09:44:54.756Z] time="2020-06-24T09:44:54Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=2.951466564s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=4
[2020-06-24T09:44:58.064Z] time="2020-06-24T09:44:57Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=5.846633673s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=5
[2020-06-24T09:45:03.360Z] time="2020-06-24T09:45:03Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=11.759423105s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=6
[2020-06-24T09:45:07.566Z] time="2020-06-24T09:45:07Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=15.473616343s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=7
[2020-06-24T09:45:11.778Z] time="2020-06-24T09:45:11Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=19.539347394s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=8
[2020-06-24T09:45:18.372Z] time="2020-06-24T09:45:18Z" level=warning msg="Waiting for more hits in the index" currentHits=4 desiredHits=5 elapsedTime=26.711032526s index=metricbeat-7.7.0-mysql-percona-5.7.24-efnualy3 retry=9
[2020-06-24T09:45:24.971Z] time="2020-06-24T09:45:24Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=32.928778312s retries=10
[2020-06-24T09:45:24.971Z] time="2020-06-24T09:45:24Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=6.442735ms retries=1
[2020-06-24T09:45:25.234Z] Stopping metricbeat_metricbeat_1 ... 
[2020-06-24T09:45:25.758Z] 
Stopping metricbeat_metricbeat_1 ... done
Removing metricbeat_metricbeat_1 ... 
[2020-06-24T09:45:25.758Z] 
Removing metricbeat_metricbeat_1 ... done
Going to remove metricbeat_metricbeat_1
[2020-06-24T09:45:26.331Z] Stopping metricbeat_mysql_1 ... 
[2020-06-24T09:45:29.637Z] 
Stopping metricbeat_mysql_1 ... done
Removing metricbeat_mysql_1 ... 
[2020-06-24T09:45:29.637Z] 
Removing metricbeat_mysql_1 ... done
Going to remove metricbeat_mysql_1
[2020-06-24T09:45:30.212Z] Pulling mysql (docker.elastic.co/integrations-ci/beats-mysql:percona-8.0.13-4-1)...
[2020-06-24T09:45:30.473Z] percona-8.0.13-4-1: Pulling from integrations-ci/beats-mysql
[2020-06-24T09:45:38.626Z] metricbeat_elasticsearch_1 is up-to-date
[2020-06-24T09:45:38.626Z] Creating metricbeat_mysql_1 ... 
[2020-06-24T09:46:03.172Z] 
Creating metricbeat_mysql_1 ... done
Found orphan containers (metricbeat_mysql_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[2020-06-24T09:46:03.172Z] metricbeat_elasticsearch_1 is up-to-date
[2020-06-24T09:46:03.172Z] Creating metricbeat_metricbeat_1 ... 
[2020-06-24T09:46:03.172Z] 
Creating metricbeat_metricbeat_1 ... done
time="2020-06-24T09:46:02Z" level=info msg="Metricbeat is running configured for the service" metricbeatVersion=7.7.0 service=mysql serviceVersion=8.0.13-4 variant=Percona
[2020-06-24T09:46:25.163Z] time="2020-06-24T09:46:22Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=8.392493ms index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=1
[2020-06-24T09:46:25.164Z] time="2020-06-24T09:46:23Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=665.263956ms index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=2
[2020-06-24T09:46:25.164Z] time="2020-06-24T09:46:24Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=1.902851334s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=3
[2020-06-24T09:46:26.107Z] time="2020-06-24T09:46:25Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=3.275512135s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=4
[2020-06-24T09:46:30.318Z] time="2020-06-24T09:46:29Z" level=warning msg="Waiting for more hits in the index" currentHits=2 desiredHits=5 elapsedTime=6.99550938s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=5
[2020-06-24T09:46:36.920Z] time="2020-06-24T09:46:36Z" level=warning msg="Waiting for more hits in the index" currentHits=3 desiredHits=5 elapsedTime=13.988298998s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=6
[2020-06-24T09:46:43.516Z] time="2020-06-24T09:46:42Z" level=warning msg="Waiting for more hits in the index" currentHits=4 desiredHits=5 elapsedTime=19.909704024s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=7
[2020-06-24T09:46:50.110Z] time="2020-06-24T09:46:49Z" level=warning msg="Waiting for more hits in the index" currentHits=4 desiredHits=5 elapsedTime=27.311254079s index=metricbeat-7.7.0-mysql-percona-8.0.13-4-afxrvg30 retry=8
[2020-06-24T09:46:58.269Z] time="2020-06-24T09:46:56Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=34.43023066s retries=9
[2020-06-24T09:46:58.269Z] time="2020-06-24T09:46:56Z" level=info msg="Hits number satisfied" currentHits=5 desiredHits=5 elapsedTime=6.058308ms retries=1
[2020-06-24T09:46:58.269Z] Stopping metricbeat_metricbeat_1 ... 
[2020-06-24T09:46:58.269Z] 
Stopping metricbeat_metricbeat_1 ... done
Removing metricbeat_metricbeat_1 ... 
[2020-06-24T09:46:58.269Z] 
Removing metricbeat_metricbeat_1 ... done
Going to remove metricbeat_metricbeat_1
[2020-06-24T09:46:58.845Z] Stopping metricbeat_mysql_1 ... 
[2020-06-24T09:47:02.154Z] 
Stopping metricbeat_mysql_1 ... done
Removing metricbeat_mysql_1 ... 
[2020-06-24T09:47:02.154Z] 
Removing metricbeat_mysql_1 ... done
Going to remove metricbeat_mysql_1
[2020-06-24T09:47:02.154Z] Stopping metricbeat_elasticsearch_1 ... 
[2020-06-24T09:47:03.104Z] 
Stopping metricbeat_elasticsearch_1 ... done
Removing metricbeat_elasticsearch_1 ... 
[2020-06-24T09:47:03.104Z] 
Removing metricbeat_elasticsearch_1 ... done
Removing network metricbeat_default
[2020-06-24T09:47:03.366Z] <?xml version="1.0" encoding="UTF-8"?>
[2020-06-24T09:47:03.366Z] <testsuites name="main" tests="7" skipped="0" failures="0" errors="0" time="669.604037876">
[2020-06-24T09:47:03.366Z]   <testsuite name="As a Metricbeat developer I want to check that default configuration works as expected" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
[2020-06-24T09:47:03.366Z]   <testsuite name="As a Metricbeat developer I want to check that the Apache module works as expected" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
[2020-06-24T09:47:03.366Z]   <testsuite name="As a Metricbeat developer I want to check that the MySQL module works as expected" tests="7" skipped="0" failures="0" errors="0" time="624.706250478">
[2020-06-24T09:47:03.366Z]     <testcase name="Check MariaDB-10.2.23 is sending metrics to Elasticsearch without errors" status="passed" time="91.996887487"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check MariaDB-10.3.14 is sending metrics to Elasticsearch without errors" status="passed" time="75.493145297"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check MariaDB-10.4.4 is sending metrics to Elasticsearch without errors" status="passed" time="93.041017059"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check MySQL-5.7.12 is sending metrics to Elasticsearch without errors" status="passed" time="86.656833664"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check MySQL-8.0.13 is sending metrics to Elasticsearch without errors" status="passed" time="83.28437964"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check Percona-5.7.24 is sending metrics to Elasticsearch without errors" status="passed" time="83.979611944"></testcase>
[2020-06-24T09:47:03.366Z]     <testcase name="Check Percona-8.0.13-4 is sending metrics to Elasticsearch without errors" status="passed" time="87.654611094"></testcase>
[2020-06-24T09:47:03.366Z]   </testsuite>
[2020-06-24T09:47:03.366Z]   <testsuite name="As a Metricbeat developer I want to check that the Redis module works as expected" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
[2020-06-24T09:47:03.366Z]   <testsuite name="As a Metricbeat developer I want to check that the vSphere module works as expected" tests="0" skipped="0" failures="0" errors="0" time="0"></testsuite>
[2020-06-24T09:47:03.366Z] </testsuites>+ sed -e 's/^[ \t]*//; s#>.*failed$#>#g' outputs/TEST-metricbeat-mysql
[2020-06-24T09:47:03.366Z] + grep -E '^<.*>$'
[2020-06-24T09:47:03.366Z] + exit 0
[2020-06-24T09:47:03.402Z] Recording test results
[2020-06-24T09:47:03.889Z] Archiving artifacts
[2020-06-24T09:47:04.971Z] Stage "Release" skipped due to when conditional
[2020-06-24T09:47:05.229Z] Running on worker-1225339 in /var/lib/jenkins/workspace/stack_e2e-testing-mbp_PR-140
[2020-06-24T09:47:05.266Z] [INFO] getVaultSecret: Getting secrets
[2020-06-24T09:47:05.326Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-06-24T09:47:07.215Z] + chmod 755 generate-build-data.sh
[2020-06-24T09:47:07.216Z] + ./generate-build-data.sh https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-140/ https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-140/runs/10 UNSTABLE 1373639
[2020-06-24T09:47:07.216Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-140/runs/10/steps/?limit=10000 -o steps-info.json
[2020-06-24T09:47:07.917Z] INFO: curl https://apm-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/stack/e2e-testing-mbp/PR-140/runs/10/tests/?status=FAILED -o tests-errors.json

@mdelapenya mdelapenya force-pushed the ingest-manager-deploy-stand-alone-impl branch from d13da16 to c00ef94 Compare June 19, 2020 08:06
@mdelapenya mdelapenya marked this pull request as ready for review June 24, 2020 08:23
parameters {
choice(name: 'runTestsSuite', choices: ['all', 'helm', 'ingest-manager', 'metricbeat'], description: 'Choose which test suite to run (default: all)')
choice(name: 'LOG_LEVEL', choices: ['INFO', 'DEBUG'], description: 'Log level to be used')
choice(name: 'QUERY_MAX_ATTEMPTS', choices: ['5', '10', '20'], description: 'Number of attempts to create the connection to Elasticsearch')
Copy link
Contributor Author

@mdelapenya mdelapenya Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this argument, as the code is not using a fixed retry option any more

}).Error("The Kibana instance could not get the healthy status")
}

imts.StandAlone.RuntimeDependenciesStartDate = time.Now()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking when the runtime deps are started. We want to have here a lower boundary for queries

Comment on lines +115 to +116
maxTimeout := time.Duration(30) * time.Second
minimumHitsCount := 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With just one hit found in 30 secs, we should fail the assertion

Copy link
Contributor

@EricDavisX EricDavisX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it - this is great. Thanks Manu


// WaitForNumberOfHits waits for an elasticsearch query to return more than a number of hits,
// returning false if the query does not reach that number in a defined number of time.
func WaitForNumberOfHits(indexName string, query map[string]interface{}, desiredHits int, maxTimeout time.Duration) (SearchResult, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fabulous. I wonder if (in a coming PR) the next step will be to parametrize this further and make it even more re-usable than it is. I see we have the index, and # of hits, timeout, and the query.

It may not be easy or quite appropriate, but I expect keeping fewer copies of the big 'query' listed in code the better... we can chat it, and its certainly mergeable as is, I'm just thinking long term (the first thing someone will do is another query check for something different in ES I'm betting!)

maxTimeout := time.Duration(queryRetryTimeout) * time.Minute
minimumHitsCount := 100

result, err := searchAgentData(sats.Hostname, sats.RuntimeDependenciesStartDate, minimumHitsCount, maxTimeout)
Copy link
Contributor Author

@mdelapenya mdelapenya Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the moment the runtime deps (kibana + ES) started to check for documents

maxTimeout := time.Duration(30) * time.Second
minimumHitsCount := 1

result, err := searchAgentData(sats.Hostname, sats.AgentStoppedDate, minimumHitsCount, maxTimeout)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the moment the agent stopped to check for documents

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have caught this earlier, but indeed - we should put in some minimal (1 second or 2??) padding on the chance that a doc was sent right as agent is stopping and is in ES microseconds after the agent stop time is recorded @mdelapenya what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flakiness at sight!!

TBH not sure, we can add a few seconds to that time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge as is, so we can observe how it behaves

@mdelapenya mdelapenya changed the title [Ingest-Manager] Implementatin for the Deploy scenario of the stand-alone mode [Ingest-Manager] Implementation for the Deploy scenario of the stand-alone mode Jun 24, 2020
@mdelapenya mdelapenya merged commit 2bbd9ed into elastic:master Jun 24, 2020
@mdelapenya mdelapenya deleted the ingest-manager-deploy-stand-alone-impl branch June 24, 2020 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants